﻿using System;
using UnityEngine;

namespace Gp.Scripts.Core
{
    public enum LayerEnum {
        Obstacle,
        Wall,
        Ground,
        BattleCharacter,
    }
    
    public static class LayerConstExtend {
        public static string ToLayerName (this LayerEnum layer) {
            return layer switch {
                LayerEnum.Obstacle => "Obstacle",
                LayerEnum.Wall => "Wall",
                LayerEnum.Ground => "Ground",
                LayerEnum.BattleCharacter => "BattleCharacter",
                _ => throw new ArgumentOutOfRangeException(nameof(layer), layer, null)
            };
        }
        
        
        public static int ToLayerInt(this LayerEnum layer) {
            return LayerMask.NameToLayer(layer.ToLayerName());
        }
    } 
}